home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / ITOAM.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  755b  |  34 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8.         extrn    sl_malloc:far, sl_utoa:far,sl_itoa:far
  9. ;
  10. ;        These routines convert the value in AX to a string
  11. ;        of digits.  They automatically allocate storage on the
  12. ;        heap for their results and return a pointer to the new
  13. ;        string in ES:DI.
  14. ;
  15. ;        These routines return the carry set if there was a memory
  16. ;        allocation error (insufficient room on heap).
  17. ;
  18. ;
  19. ; ITOAM-    Processes 16-bit signed value in AX.
  20. ;
  21.         public    sl_itoam
  22. sl_itoam    proc    far
  23.         push    cx
  24.         mov    cx, 7        ;Max 7 chars.
  25.         call    sl_malloc
  26.         pop    cx
  27.         jnc    GotoITOA
  28.         ret
  29. GotoITOA:    jmp    sl_itoa
  30. sl_itoam    endp
  31. ;
  32. ;
  33. stdlib        ends
  34.         end